package com.logicalthinking.socialmall.controller.admin;

import com.github.chenlijia1111.utils.common.Result;
import com.github.chenlijia1111.utils.core.annos.PropertyCheck;
import com.logicalthinking.socialmall.biz.SystemConfigBiz;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统设置表
 *
 * @author chenLiJia
 * @since 2020-02-17 14:43:59
 **/
@RestController
@RequestMapping(value = "admin/system/config")
@Api(tags = "系统配置")
@PropertyCheck
public class SystemConfigController {

    @Autowired
    private SystemConfigBiz biz;//系统配置


    /**
     * 配置服务费比例 保留四位小数
     *
     * @param serviceFeeRatio
     * @return
     */
    @PostMapping(value = "serviceFee/config")
    @ApiOperation(value = "配置服务费比例")
    public Result configServiceFee(Double serviceFeeRatio) {
        return biz.configServiceFee(serviceFeeRatio);
    }

    /**
     * 查找服务费配置比例
     *
     * @return
     */
    @GetMapping(value = "serviceFee")
    @ApiOperation(value = "查找服务费配置比例")
    public Result findServiceFee() {
        return biz.findServiceFee();
    }

}
